<div id="pageInfo" data-title="我的咨询"></div>
<section class="consult_list">
    {set:$queryConsultList = Api::run('getUcenterConsult')}
	{foreach:items = $queryConsultList->find()}
	<script>var item{$key} = {echo:JSON::encode($item)};</script>
	<div class="consult">
		<u class="status">{if:$item['status']==1} <span onclick='show_msg(item{$key})'>查看</span>{else:}未回复{/if}</u>
		<time>{echo:substr($item['time'],0,10)}</time>
		<article>{$item['question']}</article>
		<a href="{url:/site/products/id/$item['gid']}">{$item['name']}</a>
	</div>
	{/foreach}
</section>
{$queryConsultList->getPageBar()}

{if:!$items}
<section class="no_tip">暂无记录</section>
{/if}

<script type="text/javascript">
function show_msg(obj)
{
    var content = "<strong>咨询内容：</strong><p>"+obj.question+"</p><p>"+obj.time+"</p><hr/>";
    if(obj.answer)
    {
        content+= "<strong>商家回复：</strong><p>"+obj.answer+"</p><p>"+obj.reply_time+"</p>";
    }
    else
    {
        content+= "<strong>商家回复：</strong><p>请耐心等待...</p>";
    }
    art.dialog({"title":"商品咨询","content":content,"ok":function(){return true;}});
}
$(function(){
	// 隐藏底部导航
	hideNav();
});
</script>
